<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
if($_RQ['op']=='list'){
	//搜索
	$params=array();
	if(!empty($_RQ['c_m'])){
		$params['this']=intval($_RQ['c_m']);
		$return['params']['c_m']=$_RQ['c_m'];
	}
	$fields=array('uniacid','uid','runtime','plugin','action','op','createtime');
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$total='';
	$list=pdo_getslice('core_access_log',$params,array($pindex,$psize),$total,$fields,'','id desc');
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'访问记录'),
			//array('op'=>'del','title'=>'清空访问记录'),
		),
		'list'=>array('data'=>'list','edit'=>false,'delall'=>false,'del_one'=>false,'list'=>array(
			array('name'=>'uniacid','title'=>'访问主账户','type'=>'string'),
			array('name'=>'uid','title'=>'访问者id','type'=>'string'),
			array('name'=>'runtime','title'=>'响应时间（毫秒）','type'=>'string'),
			array('name'=>'plugin','title'=>'访问插件','type'=>'string'),
			array('name'=>'action','title'=>'访问页面action','type'=>'string'),
			array('name'=>'op','title'=>'访问op','type'=>'string'),
			array('name'=>'createtime','title'=>'访问时间','type'=>'time'),
		)),
	);
	$return['htmls']=$htmls;
	//$cs=var_export($cs,true);
	//exi($cs,'error');
	exi($return);
}
if($_RQ['op'] == 'del'){
	//暂时不清空
	exi('清空成功！','',array('op'=>'list'));
}
